package pl.game.utils;

import java.io.File;
import java.io.InputStream;

import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;

import pl.game.map.Map;

public class MarshalUtils {
	
	public static Map unmarshalMap(InputStream f){
		
		Serializer serializer = new Persister();

		Map map = null;
		try {
			map = serializer.read(Map.class, f);
		} catch (Exception e) {
			System.out.println("Error reading map!");
			e.printStackTrace();
		}
		
		return map;
		
	}

}
